<?php
class IndexAction extends CommonAction {
	
	
	// 框架首页
	public function index() {
		C ( 'SHOW_RUN_TIME', false ); // 运行时间显示
		C ( 'SHOW_PAGE_TRACE', false );
		R("Public/left");
		if (isset($_SESSION['usergroup'])){
			$this->assign('usergroup',$_SESSION['usergroup']);
		}
		else {
			$Model = new Model(); // 实例化一个model对象 没有对应任何数据表
			$result=$Model->query("select a.name from ".C('DB_PREFIX')."role a,".C('DB_PREFIX')."role_user b where a.id=b.role_id and b.user_id=".$_SESSION[C('USER_AUTH_KEY')]);
			//$result=$Model->table(C('DB_PREFIX')."role a,".C('DB_PREFIX')."role_user b)->where(a.id=b.role_id and b.user_id=".$_SESSION[C('USER_AUTH_KEY')])->field('a.name')->select();
			$this->assign('usergroup',$result[0]['name']);
	    }
		$this->display();
	}
	
	

}
?>